﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Web;

namespace LY.Manage.WebApp
{
    public class StringHelper
    {
         //弹出信息是否显示

        public static bool IsYesNO=true;
        public static string g_str = "@`1@`2@`3@`4@`5";
        public static string  htmlCode="";
        public static string queryUrl = "http://192.168.1.106:4000/IndexHandler.ashx?";
        /// <summary>
        /// 服务字符串 编号，参数
        /// </summary>
        /// <param name="bianhao">编号</param>
        /// <param name="al">参数</param>
        /// <returns></returns>
        public static string GetResultStr(string bianhao, ArrayList al)
        {
            string str = "";
            str = "b="+bianhao;
            str = str + g_str;
            for (int i = 0; i < al.Count; i++)
            {
                str = str + "@`" + al[i].ToString();
            }
            return str;
        }
        public static string  Getres(string postdata)
        {
            HttpItem httpItem = new HttpItem()
            {

                Method = "post",
                URL = queryUrl,
                PostDataType = PostDataType.String,
                Postdata = postdata,
                ContentType = "application/x-www-form-urlencoded"
            };
            HttpHelper httpHelper = new HttpHelper();
            HttpResult httpResult = httpHelper.GetHtml(httpItem);
            if (httpResult.StatusCode != HttpStatusCode.OK)
            {
                return null;
            }

            htmlCode = httpResult.Html;

            return htmlCode;
        }
    }
  }
